This project will examine the factors related to the length of stay for pediatric patients with behavioral health concerns in the CHOP emergency department.
Staff involved on a consultation basis are ED Psychiatrist Andi Fu, ED Physician Jeremy Espositio, and ED Physician and Director of Emergency Information Systems, Joseph Zorc, MD.
According to national surveys, as many as one in six U.S. children between the ages of 6 and 17 has a treatable mental health disorder (Whitney and Peterson 2019). For many parents of children struggling with behavioral health needs, taking their child to the emergency department (ED) may be their first contact and last resort to access behavioral health services. However, emergency departments are not well suited to meet behavioral service needs. The increased need for behavioral health services nationally is outpacing the rate of available behavioral health providers. As such, children who present to the ED with behavioral health needs are susceptible to prolonged length of stays (LOS) with some studies showing longer LOS than patients without behavioral health conditions(Case et al. 2011).
Several studies have examined the relationship between patient and hospital characteristics and LOS, but to date, none have examined the additional influence of within-ED behavioral health actions and decisions on LOS (Chakravarthy et al. 2017; Nash et al. 2021; Case et al. 2011).
This project will include demographic, emergency department, and behavioral health activity factors. Identifying and understanding the relative impact of these factors may help with triaging and disposition decisions to reduce LOS. This reduction may not necessarily lead to a more immediate implementation of behavioral health services, but it could still improve patient satisfaction, ED throughput, and lower costs.
This project is interdisciplinary due to the collaboration between medical ED providers and staff and behavioral health providers. Patients with behavioral health conditions are present everywhere within a hospital, but their main points of entry are: directly with a behavioral health department or indirectly through primary care and the emergency department. For the latter, this means such patients are requesting assistance from providers who are not specifically trained in assessing or managing patients with behavioral health conditions. On the other hand, behavioral health providers may be less likely to have experience working with patients with high acuity or co-morbid medical conditions. My discussions with colleagues have provided me with information about the range of factors that need to be considered in determining what in hospital and outside of the hospital services are used to help patients during their admission. CHOP has an outdated dashboard with a few relevant factors, but it is outdated and has not incorporated recent developments in tracking data about these patients.
The cohort for this analysis is patients with mental health emergencies seen in the CHOP Emergency Department (ED and EDECU - Emergency Department Extended Care Unit). Data were queried from CHOP’s data warehouse (CDW), which is built from data stored in the EPIC EHR.
Admissions were included in this analysis based on:
Admissions occurring from 2020 to the present.
Patients being between 5 and 18 years old at the time of the ED admission as mental health diagnoses are uncommon in infants and toddlers.
Having at least one of the several Inclusion Variables focusing on ED care activities and behavioral-health data obtained during the admission.
Variables with many levels were grouped to the top 5 to make comparisons easier to interpret.
Primary outcomes were the total length of stay (LOS) as a continuous variable and prolonged length of stay as a categorical variable (< 24 hours versus >=24 hours).
Descriptive statistics and plots were created to understand the nature of LOS in this cohort.
To identify risk factors associated with prolonged LOS, we conducted logistic regression analyses, calculating odds ratios (OR) with 95% confidence intervals (CI). For the multivariate regression model, we selected the same variables.
## Get data from the CDW
ed_encs_raw <- run_sql("select * from marts_dev.proctors.bh_ed_encs", dsn = "CDWUAT", lowercase_names = TRUE)
## Start data prep by re-coding indicators and lumping factors with values that are low in frequency.
df <- ed_encs_raw %>%
# filter(age_at_visit <= 18) %>%
mutate(weekday_ind = as.numeric(weekday_ind)) %>%
mutate_at(
vars(ends_with("ind") & !starts_with("mychop")),
~ (recode_factor(., "1" = "1", "0" = "0", .missing = "0"))
) %>% # take all of the indicators and make the
# missing zeros. Due to how this was not set within the SQL
mutate_at(
vars(ends_with("ind") & !starts_with("mychop")),
~ (fct_inseq(.))
) %>%
mutate( ## create and modify factors including cleaning up text values
mychop_activation_ind = recode_factor(mychop_activation_ind, "1" = "Active", "0" = "Inactive"),
sex = recode_factor(sex, M = "Male", F = "Female", U = "Unknown"),
payor_group = as.factor(str_to_title(payor_group)),
primary_medical_diagnosis_name = case_when(
str_detect(primary_medical_diagnosis_name, regex("poison", ignore_case = T)) ~ "Overdose",
TRUE ~ primary_medical_diagnosis_name
),
ed_discharge_disposition =
case_when(
str_detect(ed_discharge_disposition, "Psychiatric") ~ "Psychiatry Facility",
TRUE ~ ed_discharge_disposition
),
ed_los_hrs_cat = if_else(total_ed_hrs >= 24, "ED LOS >= 24", "ED LOS < 24"),
ed_los_hrs_cat_12 = if_else(total_ed_hrs >= 12, "ED LOS >= 12", "ED LOS < 12"),
ed_discharge_disposition = fct_lump_n(ed_discharge_disposition, 10),
preferred_language = fct_lump_n(preferred_language, 2),
race = fct_lump_n(race, 5),
primary_bh_diagnosis_name = fct_lump_n(primary_bh_diagnosis_name, 10),
primary_medical_diagnosis_name = fct_lump_n(primary_medical_diagnosis_name, 5),
ed_discharge_destination = fct_lump_n(ed_discharge_destination, 5),
ed_arrival_mode = fct_lump_n(ed_arrival_mode, 5),
ed_psych_discharge_location = fct_lump(ed_psych_discharge_location, 10),
race_ethnicity = fct_lump(race_ethnicity, 5),
mailing_zip = fct_lump(mailing_zip, 5),
county = fct_lump(county, 5),
bhs_suicidal_ideation_score = case_when(
str_detect(bhs_suicidal_ideation_score, "and no current or past suicidal thoughts") ~ "No past or current SI",
str_detect(bhs_suicidal_ideation_score, "and no current suicidal thoughts") ~ "Lifetime SI",
str_detect(bhs_suicidal_ideation_score, "and current suicidal thoughts") ~ "Current SI",
TRUE ~ bhs_suicidal_ideation_score
),
edecu_los_hrs = na_if(edecu_los_hrs, 0) ## remove zeros as they are not measured as a zero, just not existing.
) %>%
mutate( # changing the levels on factors
race = fct_relevel(race, "White", "Black or African American", "Asian"),
payor_group = fct_relevel(payor_group, "Medical Assistance"),
bhs_depression_score = fct_relevel(bhs_depression_score, "Mild Depression", "Moderate Depression", "Severe Depression"),
ed_discharge_disposition = fct_relevel(ed_discharge_disposition, "Discharge"),
bh_discharge_disposition = fct_relevel(bh_discharge_disposition, "No Intervention"),
bhs_suicidal_ideation_score = fct_relevel(bhs_suicidal_ideation_score, "No past or current SI", "Current SI"),
ethnicity = fct_relevel(ethnicity, "Not Hispanic Or Latino"),
arrival_shift = fct_relevel(arrival_shift, "Day (8a-4p)"),
week_day = fct_relevel(week_day, "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"),
age_group = fct_relevel(age_group, "5-8", "9-12", "13-15", "16-18"),
race_ethnicity = fct_relevel(race_ethnicity, "Non-Hispanic White"),
bhs_depression_score = fct_explicit_na(bhs_depression_score, na_level = "(Not Assessed)"),
bhs_suicidal_ideation_score = fct_explicit_na(bhs_suicidal_ideation_score, na_level = "(Not Assessed)"),
primary_medical_diagnosis_name = fct_explicit_na(primary_medical_diagnosis_name, na_level = "(BH diagnosis)"),
primary_bh_diagnosis_name = fct_explicit_na(primary_bh_diagnosis_name, na_level = "(Medical diagnosis)"),
primary_bh_diagnosis_name = fct_relevel(primary_bh_diagnosis_name, "(Medical diagnosis)"),
primary_medical_diagnosis_name = fct_relevel(primary_medical_diagnosis_name, "(BH diagnosis)"),
ed_discharge_destination = fct_relevel(ed_discharge_destination, "Patient/family/home"),
county = fct_relevel(county, "Philadelphia")
)
## Name columns that we will turn to factors
cols <- c(
"pediatric_age_days_group", "sex", "race", "ethnicity", "payor_group", "race_ethnicity", "primary_diagnosis_category", "ed_los_hrs_cat", "bhs_depression_score",
"bhs_suicidal_ideation_score", "ed_discharge_disposition", "preferred_language",
"ed_discharge_location", "ed_psych_discharge_location", "bh_discharge_disposition", "arrival_shift", "primary_bh_diagnosis_name", "primary_medical_diagnosis_name", "age_group", "week_day", "ed_arrival_mode", "ed_discharge_destination"
)
df[cols] <- lapply(df[cols], as.factor)
df <- df %>%
set_variable_labels(.labels = nice_display_names(., keep_uppercase = c("bh", "edecu", "bhs", "bhip", "mh", "ed", "csn", "mrn", "ip", "zip", "asq"))) # set labels that will make text in charts look formatted betterCharting the length of stay over time using a statistical process control chart (SPC) chart. This will identify areas where the data are well above or below the established median during the length of time in the chart.
ED LOS and EDECU LOS are calculated based on the difference between their arrival time and their departure time. A total LOS was calculated as the sum of both LOS values.
# Chart the Median LOS for just ED LOS
df %>%
remove_incomplete_end_dates(ed_admit_date, period = "month") %>%
hc_spc(
# data = df,
x = ed_admit_date,
y = ed_los_hrs, chart = "xbar",
title = "Median ED Length of Stay", xlab = "Month Year", ylab = "Hours", agg.fun = "median"
)# Chart the Median LOS for just EDECU LOS
df %>%
remove_incomplete_end_dates(ed_admit_date, period = "month") %>%
hc_spc(
# data = df,
x = ed_admit_date,
y = edecu_los_hrs, chart = "xbar",
title = "Median EDECU Length of Stay", xlab = "Month Year", ylab = "Hours",
agg.fun = "median"
)# Chart the Median LOS for the sum of ED and EDECU LOS
df %>%
remove_incomplete_end_dates(ed_admit_date, period = "month") %>%
hc_spc(
# data = df,
x = ed_admit_date,
y = total_ed_hrs, chart = "xbar",
title = "Median Total (ED & EDECU) Length of Stay", xlab = "Month Year", ylab = "Hours",
agg.fun = "median"
)Distribution of LOS across the three measures. They are highly skewed, which is typical for LOS measurements across studies. LOS can be transformed to be a more normal distribution for statistical analysis, but that was not done in this analysis as transformation can make interpreting the results less straightforward.
# Create historgrams for all three measures of LOS
los_ed_hrs_histogram <-
ggplot(df) +
ggtitle("ED LOS") +
geom_histogram(aes(x = ed_los_hrs), fill = chop_colors("blue")) +
labs(
x = "Hours",
y = "Total Admissions",
title = "ED LOS"
) +
theme_chop()
los_ededu_hrs_histogram <-
ggplot(df) +
ggtitle("EDECU LOS") +
geom_histogram(aes(x = edecu_los_hrs), fill = chop_colors("blue")) +
labs(
x = "Hours",
y = "Total Admissions",
title = "EDECU LOS"
) +
theme_chop()
los_total_hrs_histogram <-
ggplot(df) +
ggtitle("Total LOS") +
geom_histogram(aes(x = total_ed_hrs),
fill = chop_colors("blue"),
binwidth = 5
) +
labs(
x = "Hours",
y = "Total Admissions",
title = "Total LOS"
) +
theme_chop()
## Arrange them as a grid.
grid.arrange(los_ed_hrs_histogram, los_ededu_hrs_histogram, los_total_hrs_histogram,
widths = c(0.3, 0.3, 0.3), nrow = 1
)Demographic and other patient-level characteristics.
Summary Highlights: Most patients are females above the age of 13, and are non-hispanic blacks. In addition, most patients are from Philadelphia, are primarily English speaking and have Medical Assistance.
## Create an easy to re-use column grouping
pat_chars <- c("age_group", "sex", "race_ethnicity", "county", "preferred_language", "payor_group", "mychop_activation_ind")
df_char_summary <- df %>%
select(all_of(pat_chars), total_ed_hrs)
## Create good looking summary tables
tbl1 <-
df_char_summary %>%
mutate_at(
vars(ends_with("ind")),
~ (recode(., "1" = "Yes", "0" = "No"))
) %>%
tbl_summary(
include = pat_chars,
statistic = list(
all_continuous() ~ "{mean} ({sd})" # ,
),
digits = all_continuous() ~ 2,
missing = "no"
) %>%
add_n() %>%
modify_caption("**Patient Characteristics**") %>%
modify_header(label ~ "**Variable**")
tbl2 <-
df_char_summary %>%
mutate_at(
vars(ends_with("ind")),
~ (recode(., "1" = "Yes", "0" = "No"))
) %>%
tbl_continuous(
variable = total_ed_hrs,
include = pat_chars
) %>%
modify_header(all_stat_cols() ~ "**Median LOS in Hours**")
tbl_final <-
tbl_merge(list(tbl1, tbl2)) %>%
modify_spanning_header(everything() ~ NA)
tbl_final| Variable | N | N = 7,9191 | Median LOS in Hours2 |
|---|---|---|---|
| Age Group | 7,919 | ||
| 5-8 | 826 (10%) | 5 (3, 7) | |
| 9-12 | 1,756 (22%) | 5 (4, 9) | |
| 13-15 | 3,056 (39%) | 6 (4, 10) | |
| 16-18 | 2,281 (29%) | 6 (4, 9) | |
| Sex | 7,919 | ||
| Male | 2,859 (36%) | 5 (4, 8) | |
| Female | 5,059 (64%) | 6 (4, 9) | |
| Unknown | 1 (<0.1%) | 8 (8, 8) | |
| Race Ethnicity | 7,918 | ||
| Non-Hispanic White | 2,856 (36%) | 6 (4, 8) | |
| Asian | 236 (3.0%) | 5 (4, 8) | |
| Hispanic or Latino | 713 (9.0%) | 6 (4, 8) | |
| Non-Hispanic Black | 3,473 (44%) | 5 (4, 9) | |
| Other | 640 (8.1%) | 6 (4, 9) | |
| Unknown | 1 | ||
| County | 7,917 | ||
| Philadelphia | 3,853 (49%) | 5 (4, 9) | |
| Bucks | 446 (5.6%) | 6 (5, 9) | |
| Chester | 257 (3.2%) | 6 (4, 9) | |
| Delaware | 1,125 (14%) | 5 (4, 9) | |
| Montgomery | 845 (11%) | 6 (4, 9) | |
| Other | 1,391 (18%) | 6 (4, 8) | |
| Unknown | 2 | ||
| Preferred Language | 7,901 | ||
| English | 7,652 (97%) | 6 (4, 9) | |
| Spanish | 138 (1.7%) | 6 (4, 7) | |
| Other | 111 (1.4%) | 6 (5, 9) | |
| Unknown | 18 | ||
| Payor Group | 7,798 | ||
| Medical Assistance | 4,354 (56%) | 6 (4, 9) | |
| Charity Care | 1 (<0.1%) | 2 (2, 2) | |
| Commercial | 3,297 (42%) | 6 (4, 8) | |
| Other | 146 (1.9%) | 5 (4, 8) | |
| Unknown | 121 | ||
| Mychop Activation | 7,724 | ||
| Active | 5,472 (71%) | 6 (4, 9) | |
| Inactive | 2,252 (29%) | 6 (4, 9) | |
| Unknown | 195 | ||
|
1
n (%)
2
Median (IQR)
|
|||
These include factors determined at the beginning or end of the admission.
Summary Highlights: Most patients arrive during the day, during the school months, and via cars. The most prevalent chief complaint is “Psych Emergency” or other chief complaints with mental health types of labels. The Majority of patients are discharged home from the ED. The most common inpatient Psychiatry Discharge setting is Fairmount, followed by Belmont.
## Create an easy to re-use column grouping
ed_chars <- c('arrival_shift', 'week_day', 'school_month_ind', 'ed_arrival_mode','psych_emergency_cc_ind', 'altered_mental_status_cc_ind', 'mental_health_cc_ind', 'hr_72_revisit_ind', 'ed_discharge_disposition', 'ed_psych_discharge_location', 'ed_discharge_location', 'ed_discharge_destination')
## Create good looking summary tables
df_ed_chars_summary <- df %>%
select(all_of(ed_chars), total_ed_hrs)
tbl3 <-
df_ed_chars_summary %>%
mutate_at(
vars(ends_with("ind")),
~ (recode(., "1" = "Yes", "0" = "No"))
) %>%
tbl_summary(
include = all_of(ed_chars),
statistic = list(all_continuous() ~ "{mean} ({sd})"
),
digits = all_continuous() ~ 2
, missing = "no"
) %>%
add_n() %>%
modify_caption("**Patient Characteristics**") %>%
modify_header(label ~ "**Variable**")
tbl4 <-
df_ed_chars_summary %>%
mutate_at(
vars(ends_with("ind")),
~ (recode(., "1" = "Yes", "0" = "No"))
) %>%
tbl_continuous(
variable = total_ed_hrs,
include = all_of(ed_chars)
) %>%
modify_header(all_stat_cols() ~ "**Median LOS in Hours**")
tbl_final2 <-
tbl_merge(list(tbl3, tbl4)) %>%
modify_spanning_header(everything() ~ NA)
tbl_final2| Variable | N | N = 7,9191 | Median LOS in Hours2 |
|---|---|---|---|
| Arrival Shift | 7,919 | ||
| Day (8a-4p) | 4,135 (52%) | 6 (4, 8) | |
| Evening (4p-12a) | 3,089 (39%) | 5 (4, 8) | |
| Overnight (12a-8a) | 695 (8.8%) | 7 (4, 13) | |
| Week Day | 7,919 | ||
| Mon | 1,295 (16%) | 6 (4, 9) | |
| Tue | 1,343 (17%) | 6 (4, 9) | |
| Wed | 1,305 (16%) | 6 (4, 9) | |
| Thu | 1,262 (16%) | 6 (4, 9) | |
| Fri | 1,117 (14%) | 6 (4, 8) | |
| Sat | 765 (9.7%) | 6 (4, 9) | |
| Sun | 832 (11%) | 5 (4, 8) | |
| School Month | 7,919 | 6,735 (85%) | |
| No | 6 (4, 10) | ||
| Yes | 6 (4, 8) | ||
| ED Arrival Mode | 7,919 | ||
| Car | 3,372 (43%) | 6 (4, 9) | |
| Ems-other | 86 (1.1%) | 7 (5, 11) | |
| Not Applicable | 2,737 (35%) | 6 (4, 9) | |
| Private Vehicle | 1,258 (16%) | 6 (4, 8) | |
| Other | 466 (5.9%) | 5 (4, 8) | |
| Psych Emergency Cc | 7,919 | 3,548 (45%) | |
| No | 5 (4, 8) | ||
| Yes | 6 (4, 18) | ||
| Altered Mental Status Cc | 7,919 | 167 (2.1%) | |
| No | 6 (4, 9) | ||
| Yes | 6 (5, 9) | ||
| Mental Health Cc | 7,919 | 4,248 (54%) | |
| No | 6 (4, 8) | ||
| Yes | 6 (4, 13) | ||
| Hr 72 Revisit | 7,919 | 175 (2.2%) | |
| No | 6 (4, 9) | ||
| Yes | 6 (4, 9) | ||
| ED Discharge Disposition | 7,919 | ||
| Discharge | 4,286 (54%) | 5 (3, 6) | |
| Admit | 3,011 (38%) | 7 (5, 9) | |
| AMA | 6 (<0.1%) | 5 (3, 5) | |
| EDECU | 9 (0.1%) | 5 (4, 8) | |
| Left Before Discharge (Eloped) | 14 (0.2%) | 5 (4, 6) | |
| LWBS After Triage | 4 (<0.1%) | 3 (3, 3) | |
| Non-Patient ED Screen with Refusal of Treatment/Transfer | 1 (<0.1%) | 26 (26, 26) | |
| NOT APPLICABLE | 6 (<0.1%) | 6 (6, 7) | |
| Psychiatry Facility | 553 (7.0%) | 41 (24, 86) | |
| Transfer from Triage (Other) | 2 (<0.1%) | 119 (89, 148) | |
| Transfer from Triage to HUP | 2 (<0.1%) | 8 (7, 10) | |
| Transfered to Another Facility(Not from Triage) | 25 (0.3%) | 18 (7, 60) | |
| ED Psych Discharge Location | 493 | ||
| Belmont | 111 (23%) | 30 (20, 71) | |
| Devereux | 9 (1.8%) | 41 (23, 258) | |
| Fairmount | 163 (33%) | 43 (25, 93) | |
| Foundations | 22 (4.5%) | 38 (20, 85) | |
| Friends | 54 (11%) | 34 (20, 64) | |
| Horsham Clinic | 116 (24%) | 42 (25, 88) | |
| Kids Clinic | 11 (2.2%) | 57 (49, 96) | |
| Rockford | 7 (1.4%) | 49 (31, 64) | |
| Unknown | 7,426 | ||
| ED Discharge Location | 7,919 | ||
| ED | 3,960 (50%) | 4 (3, 6) | |
| EDECU | 1,080 (14%) | 46 (23, 98) | |
| Inpatient | 2,521 (32%) | 6 (5, 8) | |
| MBU | 358 (4.5%) | 7 (5, 9) | |
| ED Discharge Destination | 7,919 | ||
| Patient/family/home | 1,212 (15%) | 7 (5, 9) | |
| Not Applicable | 6,337 (80%) | 5 (4, 8) | |
| Transfer To Another Facility | 78 (1.0%) | 7 (5, 11) | |
| Transfer To Psych Facility | 209 (2.6%) | 8 (6, 14) | |
| Transfer To Rehab-cssh | 29 (0.4%) | 5 (3, 7) | |
| Other | 54 (0.7%) | 7 (5, 10) | |
|
1
n (%)
2
Median (IQR)
|
|||
#footnote = AMA= against medical advice;These include diagnosis groups for behavioral health and non-behavioral health conditions.
Summary Highlights: The majority of patients have a primary diagnoses involving a behavioral health condition. Among the behavioral health diagnoses, suicidal ideation/self-injury are the most prevalent, followed by aggression, agitation, and anger, eating disorders, and substance use disorders. Most patients do not have a complex chronic condition and are not medically complex.
## Create an easy to re-use column grouping
dx_chars <- c('primary_diagnosis_is_bh_ind', 'primary_bh_diagnosis_name', 'primary_medical_diagnosis_name', 'complex_chronic_condition_ind', 'medically_complex_ind')
df_dx_chars_summary <- df %>%
select(all_of(dx_chars), total_ed_hrs)
## Create good looking summary tables
tbl5 <-
df_dx_chars_summary %>%
mutate_at(
vars(ends_with("ind")),
~ (recode(., "1" = "Yes", "0" = "No"))
) %>%
tbl_summary(
include = all_of(dx_chars),
statistic = list(all_continuous() ~ "{mean} ({sd})"
),
digits = all_continuous() ~ 2,
missing = "no",
missing_text = "(Missing)"
) %>%
modify_caption("**Diagnosis Characteristics**") %>%
modify_header(label ~ "**Variable**")
tbl6 <-
df_dx_chars_summary %>%
mutate_at(
vars(ends_with("ind")),
~ (recode(., "1" = "Yes", "0" = "No"))
) %>%
tbl_continuous(
variable = total_ed_hrs,
include = all_of(dx_chars)
) %>%
modify_header(all_stat_cols() ~ "**Median LOS in Hours**")
tbl_final3 <-
tbl_merge(list(tbl5, tbl6)) %>%
modify_spanning_header(everything() ~ NA)
tbl_final3| Variable | N = 7,9191 | Median LOS in Hours2 |
|---|---|---|
| Primary Diagnosis Is BH | 4,485 (57%) | |
| No | 6 (4, 8) | |
| Yes | 6 (4, 10) | |
| Primary BH Diagnosis Name | ||
| (Medical diagnosis) | 3,434 (43%) | 6 (4, 8) |
| Aggression, agitation, anger | 1,113 (14%) | 5 (4, 10) |
| Altered mental status | 383 (4.8%) | 5 (4, 7) |
| Anxiety disorders | 392 (5.0%) | 4 (3, 5) |
| Eating disorders | 767 (9.7%) | 6 (5, 7) |
| Hallucinations | 60 (0.8%) | 6 (4, 9) |
| Other mental health condition | 13 (0.2%) | 4 (2, 6) |
| Somatic disorders | 53 (0.7%) | 5 (3, 7) |
| Substances use disorders | 506 (6.4%) | 6 (4, 9) |
| Suicidal ideation, self-injury | 1,198 (15%) | 9 (5, 50) |
| Primary Medical Diagnosis Name | ||
| (BH diagnosis) | 5,287 (67%) | 5 (4, 9) |
| Abdominal And Pelvic Pain | 159 (2.0%) | 7 (5, 9) |
| Convulsions, Not Elsewhere Classified | 91 (1.1%) | 6 (4, 8) |
| Nausea And Vomiting | 81 (1.0%) | 7 (6, 9) |
| Overdose | 172 (2.2%) | 7 (5, 14) |
| Pain In Throat And Chest | 88 (1.1%) | 5 (4, 6) |
| Other | 2,041 (26%) | 6 (4, 8) |
| Complex Chronic Condition | 1,849 (23%) | |
| No | 6 (4, 9) | |
| Yes | 6 (4, 8) | |
| Medically Complex | 861 (11%) | |
| No | 6 (4, 9) | |
| Yes | 6 (4, 8) | |
|
1
n (%)
2
Median (IQR)
|
||
A summary of the behavioral health-related activities that were documented during a patient’s admission. Includes mental health screenings, notes documented, medications, safety orders, and clinical dispositions.
Summary Highlights: For behavioral health assessments, severe depression was the most common score on the BHS for those who had a history of suicidal ideation. on the ASQ, suicidal ideation was more common than suicide attempts. The most common discharged disposition by the mental health team was to outpatient therapy. Use of medications and safety orders were not common within the cohort. Of the orders, searching patients for risk of self-harm and visual observations were the most common.
## Create an easy to re-use column grouping
bh_interven <- c(
"ed_behavioral_health_screen_ind", "bhs_depression_score", "bhs_suicidal_ideation_score", "asq_suicidal_ideation_ind", "asq_suicide_attempt_ind",
"mental_health_note_ind", "psych_tech_note_ind", "social_work_disposition_ind", "bhip_disposition_ind", "bhip_consult_ind", "medically_clear_ind", #' days_until_medically_clear',
"bh_discharge_disposition"
)
med_interven <- c("behavioral_health_medication_given_ind", "agitation_order_set_ind", "ed_bh_com_order_set_ind", "edecu_bh_order_set_ind", "lorazepam_ind", "haloperidol_ind", "diphenhydramine_ind", "olanzapine_ind", "class_antianxiety_ind", "class_antihistamine_ind", "class_antipsychotic_ind")
safety_interven <- c("safety_risk_orders_ind", "restraints_ind", "care_suicidal_patient_proc_ind", "search_patients_risk_self_harm_ind", "visual_and_arms_length_ind", "visual_observation_ind", "ip_suicide_teaching_ind", "ed_bh_pathway_ind")
df_bh_interven_summary <- df %>%
select(all_of(bh_interven), all_of(med_interven), all_of(safety_interven), total_ed_hrs)
## Create good looking summary tables
tbl7 <-
df_bh_interven_summary %>%
mutate_at(
vars(ends_with("ind")),
~ (recode(., "1" = "Yes", "0" = "No"))
) %>%
tbl_summary(
# by = 'ED LOS Hrs Cat',
include = c(all_of(bh_interven), all_of(med_interven), all_of(safety_interven)),
statistic = list(all_continuous() ~ "{mean} ({sd})"),
digits = all_continuous() ~ 2,
sort = list(everything() ~ "frequency"),
missing = "no"
) %>%
add_n() %>%
modify_caption("**Behavioral Health Activities**") %>%
modify_header(label ~ "**Variable**")
tbl8 <-
df_bh_interven_summary %>%
mutate_at(
vars(ends_with("ind")),
~ (recode(., "1" = "Yes", "0" = "No"))
) %>%
tbl_continuous(
variable = total_ed_hrs,
include = c(all_of(bh_interven), all_of(med_interven), all_of(safety_interven))
) %>%
modify_header(all_stat_cols() ~ "**Median LOS in Hours**")
tbl_final4 <-
tbl_merge(list(tbl7, tbl8)) %>%
modify_spanning_header(everything() ~ NA)
tbl_final4| Variable | N | N = 7,9191 | Median LOS in Hours2 |
|---|---|---|---|
| ED Behavioral Health Screen | 7,919 | 2,541 (32%) | |
| No | 6 (4, 9) | ||
| Yes | 6 (4, 9) | ||
| BHS Depression Score | 7,919 | ||
| (Not Assessed) | 5,378 (68%) | 6 (4, 9) | |
| Severe Depression | 2,042 (26%) | 6 (4, 9) | |
| Mild Depression | 341 (4.3%) | 5 (4, 7) | |
| Moderate Depression | 158 (2.0%) | 6 (4, 8) | |
| BHS Suicidal Ideation Score | 7,919 | ||
| (Not Assessed) | 7,578 (96%) | 6 (4, 9) | |
| No past or current SI | 225 (2.8%) | 5 (4, 7) | |
| Lifetime SI | 86 (1.1%) | 6 (4, 8) | |
| Current SI | 30 (0.4%) | 6 (4, 14) | |
| ASQ Suicidal Ideation | 7,919 | 1,837 (23%) | |
| No | 5 (4, 8) | ||
| Yes | 7 (4, 30) | ||
| ASQ Suicide Attempt | 7,919 | 1,091 (14%) | |
| No | 5 (4, 8) | ||
| Yes | 8 (5, 40) | ||
| Mental Health Note | 7,919 | 5,387 (68%) | |
| No | 5 (3, 7) | ||
| Yes | 6 (4, 11) | ||
| Psych Tech Note | 7,919 | 2,711 (34%) | |
| No | 5 (3, 7) | ||
| Yes | 9 (6, 32) | ||
| Social Work Disposition | 7,919 | 3,010 (38%) | |
| No | 6 (4, 8) | ||
| Yes | 5 (4, 12) | ||
| BHIP Disposition | 7,919 | 4,114 (52%) | |
| No | 5 (4, 7) | ||
| Yes | 6 (4, 15) | ||
| BHIP Consult | 7,919 | 3,093 (39%) | |
| No | 5 (3, 7) | ||
| Yes | 8 (5, 17) | ||
| Medically Clear | 7,919 | 1,670 (21%) | |
| No | 5 (4, 8) | ||
| Yes | 7 (5, 33) | ||
| BH Discharge Disposition | 3,145 | ||
| Outpatient Therapy | 1,317 (42%) | 4 (3, 6) | |
| Inpatient Hospitalization | 977 (31%) | 24 (8, 57) | |
| Partial Hospitalization | 767 (24%) | 5 (4, 8) | |
| No Intervention | 51 (1.6%) | 4 (3, 6) | |
| Residential Treatment Facility | 33 (1.0%) | 6 (5, 9) | |
| Unknown | 4,774 | ||
| Behavioral Health Medication Given | 7,919 | 495 (6.3%) | |
| No | 5 (4, 8) | ||
| Yes | 8 (6, 39) | ||
| Agitation Order Set | 7,919 | 345 (4.4%) | |
| No | 6 (4, 9) | ||
| Yes | 7 (6, 10) | ||
| ED BH Com Order Set | 7,919 | 55 (0.7%) | |
| No | 6 (4, 9) | ||
| Yes | 7 (5, 17) | ||
| EDECU BH Order Set | 7,919 | 118 (1.5%) | |
| No | 6 (4, 8) | ||
| Yes | 113 (52, 192) | ||
| Lorazepam | 7,919 | 311 (3.9%) | |
| No | 6 (4, 8) | ||
| Yes | 7 (6, 13) | ||
| Haloperidol | 7,919 | 67 (0.8%) | |
| No | 6 (4, 9) | ||
| Yes | 7 (6, 11) | ||
| Diphenhydramine | 7,919 | 239 (3.0%) | |
| No | 6 (4, 8) | ||
| Yes | 9 (6, 52) | ||
| Olanzapine | 7,919 | 22 (0.3%) | |
| No | 6 (4, 9) | ||
| Yes | 7 (5, 10) | ||
| Class Antianxiety | 7,919 | 324 (4.1%) | |
| No | 6 (4, 8) | ||
| Yes | 7 (6, 13) | ||
| Class Antihistamine | 7,919 | 239 (3.0%) | |
| No | 6 (4, 8) | ||
| Yes | 9 (6, 52) | ||
| Class Antipsychotic | 7,919 | 96 (1.2%) | |
| No | 6 (4, 9) | ||
| Yes | 7 (6, 11) | ||
| Safety Risk Orders | 7,919 | 4,403 (56%) | |
| No | 5 (3, 7) | ||
| Yes | 7 (5, 15) | ||
| Restraints | 7,919 | 312 (3.9%) | |
| No | 6 (4, 8) | ||
| Yes | 7 (6, 16) | ||
| Care Suicidal Patient Proc | 7,919 | 1,167 (15%) | |
| No | 5 (4, 8) | ||
| Yes | 10 (6, 52) | ||
| Search Patients Risk Self Harm | 7,919 | 1,961 (25%) | |
| No | 5 (4, 7) | ||
| Yes | 13 (6, 51) | ||
| Visual And Arms Length | 7,919 | 1,183 (15%) | |
| No | 5 (4, 8) | ||
| Yes | 7 (5, 11) | ||
| Visual Observation | 7,919 | 4,021 (51%) | |
| No | 5 (3, 7) | ||
| Yes | 7 (5, 18) | ||
| IP Suicide Teaching | 7,919 | 375 (4.7%) | |
| No | 6 (4, 9) | ||
| Yes | 7 (5, 11) | ||
| ED BH Pathway | 7,919 | 2,005 (25%) | |
| No | 5 (4, 8) | ||
| Yes | 7 (4, 25) | ||
|
1
n (%)
2
Median (IQR)
|
|||
The following chart displays our predictors in a graphical form to help identify which predictors may be helpful in predictive statistical analyses. They are sorted based on contribution to the variation in LOS (R-squared).
df_pred_los <- df %>%
select(all_of(pat_chars), all_of(dx_chars), all_of(ed_chars), all_of(bh_interven), all_of(med_interven), all_of(safety_interven), total_ed_hrs, -ed_los, -ed_los_hrs_cat, -primary_diagnosis_category) %>%
rename_all(nice_display_names) %>%
rename(total_ed_hrs = "Total ED (Hours)")
plot_spread(df_pred_los, dep_var = "total_ed_hrs")Based on the strong relationship between the disposition variables and their temporal location to the discharge date (thus LOS), they were removed from further analyses.
ed_dispo_vars <- c('bh_discharge_disposition', 'ed_discharge_disposition', 'ed_psych_discharge_location', 'ed_discharge_location', 'social_work_disposition_ind', 'bhip_disposition_ind')
analysis_vars <- df %>%
select(all_of(pat_chars), all_of(dx_chars), all_of(ed_chars), all_of(bh_interven), all_of(med_interven), all_of(safety_interven), total_ed_hrs, -ed_los, -ed_los_hrs_cat, -primary_diagnosis_category, -all_of(ed_dispo_vars)) %>%
colnames(.)
df_pred_los_no_dispos <- df %>%
select(all_of(analysis_vars)) %>%
rename_all(nice_display_names) %>%
rename(total_ed_hrs = "Total ED (Hours)")
plot_spread(df_pred_los_no_dispos, dep_var = "total_ed_hrs")For a given predictor variable, the coefficient (Beta) can be interpreted as the average effect on y of a one-unit increase in the predictor (LOS), holding all other predictors fixed.
Significant values are in bold. Variables with multiple levels are in comparison to the first value (Reference –). Thus, the values after it are in comparison to that Reference.
For example, a positive beta value would mean that there is an increase in LOS hours of the x LOS hours ( beta value) for that level in comparison to the Reference level.
The influence of each variable on its own. This is similar to the graph above but allows for the examination of different levels within variables.
Key Findings: Total Length of Stay was greater for
Patients over 9 compared to Patients under 9
Female patients compared to Male
Non-Hispanic black compared to Non-Hispanic White
Medical Assistance compared to Commercial insurance
Mental Health Diagnosis compared to Medical Diagnosis
Severe Depression compared to Mild Depression
Medication ordered compared to Not ordered
Safety procedures ordered compared to Not ordered
lm_vars <- analysis_vars
df_pat_lm <- df %>%
select(all_of(lm_vars), total_ed_hrs)
df_pat_lm %>%
mutate_at(
vars(ends_with("ind")),
~ (recode(., "1" = "Yes", "0" = "No"))
) %>%
tbl_uvregression(
method = lm,
y = (total_ed_hrs),
show_single_row = vars(ends_with("ind")),
pvalue_fun = ~ style_pvalue(.x, digits = 2)
) %>%
bold_p() %>% # bold p-values under a given threshold (default 0.05)
# bold_p(t = 0.10, q = TRUE) %>% # now bold q-values under the threshold of 0.10
bold_labels() %>%
modify_caption("**Univariate Regression: Predictors of Length of Stay**") %>%
modify_header(label ~ "**Variable**") %>%
italicize_levels()| Variable | N | Beta | 95% CI1 | p-value |
|---|---|---|---|---|
| Age Group | 7917 | |||
| 5-8 | — | — | ||
| 9-12 | 12 | 8.5, 15 | <0.001 | |
| 13-15 | 8.1 | 5.2, 11 | <0.001 | |
| 16-18 | 5.0 | 2.0, 7.9 | <0.001 | |
| Sex | 7917 | |||
| Male | — | — | ||
| Female | 2.7 | 1.0, 4.4 | 0.002 | |
| Unknown | -5.7 | -78, 67 | 0.88 | |
| Race Ethnicity | 7916 | |||
| Non-Hispanic White | — | — | ||
| Asian | 0.44 | -4.5, 5.3 | 0.86 | |
| Hispanic or Latino | -0.11 | -3.1, 2.9 | 0.95 | |
| Non-Hispanic Black | 2.0 | 0.17, 3.8 | 0.033 | |
| Other | 0.62 | -2.5, 3.8 | 0.70 | |
| County | 7915 | |||
| Philadelphia | — | — | ||
| Bucks | -0.69 | -4.3, 2.9 | 0.71 | |
| Chester | -3.8 | -8.5, 0.86 | 0.11 | |
| Delaware | 2.9 | 0.40, 5.3 | 0.023 | |
| Montgomery | 0.89 | -1.9, 3.6 | 0.53 | |
| Other | -4.6 | -6.9, -2.3 | <0.001 | |
| Preferred Language | 7899 | |||
| English | — | — | ||
| Spanish | -2.5 | -8.7, 3.8 | 0.44 | |
| Other | -0.56 | -7.5, 6.4 | 0.87 | |
| Payor Group | 7796 | |||
| Medical Assistance | — | — | ||
| Charity Care | -15 | -88, 58 | 0.69 | |
| Commercial | -3.3 | -5.0, -1.7 | <0.001 | |
| Other | -4.2 | -10, 1.9 | 0.18 | |
| Mychop Activation | 7722 | 1.7 | -0.13, 3.5 | 0.069 |
| Primary Diagnosis Is BH | 7917 | 9.6 | 7.9, 11 | <0.001 |
| Primary BH Diagnosis Name | 7917 | |||
| (Medical diagnosis) | — | — | ||
| Aggression, agitation, anger | 11 | 8.5, 13 | <0.001 | |
| Altered mental status | -3.9 | -7.6, -0.16 | 0.041 | |
| Anxiety disorders | -4.7 | -8.4, -1.0 | 0.013 | |
| Eating disorders | -3.8 | -6.6, -1.0 | 0.007 | |
| Hallucinations | -0.43 | -9.5, 8.6 | 0.93 | |
| Other mental health condition | 17 | -2.0, 37 | 0.079 | |
| Somatic disorders | -4.4 | -14, 5.2 | 0.36 | |
| Substances use disorders | 4.9 | 1.6, 8.2 | 0.004 | |
| Suicidal ideation, self-injury | 29 | 27, 31 | <0.001 | |
| Primary Medical Diagnosis Name | 7917 | |||
| (BH diagnosis) | — | — | ||
| Abdominal And Pelvic Pain | -10 | -16, -4.7 | <0.001 | |
| Convulsions, Not Elsewhere Classified | -12 | -19, -4.0 | 0.003 | |
| Nausea And Vomiting | -10 | -18, -2.1 | 0.014 | |
| Overdose | 2.1 | -3.4, 7.7 | 0.45 | |
| Pain In Throat And Chest | -13 | -20, -4.9 | 0.001 | |
| Other | -8.4 | -10, -6.6 | <0.001 | |
| Complex Chronic Condition | 7917 | -6.9 | -8.8, -5.0 | <0.001 |
| Medically Complex | 7917 | -8.6 | -11, -5.9 | <0.001 |
| Arrival Shift | 7917 | |||
| Day (8a-4p) | — | — | ||
| Evening (4p-12a) | 1.2 | -0.55, 2.9 | 0.18 | |
| Overnight (12a-8a) | -0.69 | -3.7, 2.3 | 0.65 | |
| Week Day | 7917 | |||
| Mon | — | — | ||
| Tue | 2.2 | -0.66, 5.0 | 0.13 | |
| Wed | 2.3 | -0.57, 5.1 | 0.12 | |
| Thu | 1.7 | -1.2, 4.5 | 0.26 | |
| Fri | 2.0 | -1.0, 4.9 | 0.19 | |
| Sat | 3.1 | -0.18, 6.4 | 0.064 | |
| Sun | 0.37 | -2.9, 3.6 | 0.82 | |
| School Month | 7917 | 2.4 | 0.13, 4.7 | 0.039 |
| ED Arrival Mode | 7917 | |||
| Car | — | — | ||
| Ems-other | -3.7 | -12, 4.2 | 0.36 | |
| Not Applicable | 0.85 | -1.0, 2.7 | 0.37 | |
| Private Vehicle | -7.1 | -9.4, -4.7 | <0.001 | |
| Other | -0.80 | -4.4, 2.8 | 0.66 | |
| Psych Emergency Cc | 7917 | 17 | 16, 19 | <0.001 |
| Altered Mental Status Cc | 7917 | -8.8 | -14, -3.1 | 0.002 |
| Mental Health Cc | 7917 | 15 | 14, 17 | <0.001 |
| Hr 72 Revisit | 7917 | -2.7 | -8.3, 2.8 | 0.33 |
| ED Discharge Destination | 7917 | |||
| Patient/family/home | — | — | ||
| Not Applicable | 5.8 | 3.5, 8.1 | <0.001 | |
| Transfer To Another Facility | 11 | 3.0, 20 | 0.008 | |
| Transfer To Psych Facility | 15 | 9.7, 20 | <0.001 | |
| Transfer To Rehab-cssh | -4.6 | -18, 9.0 | 0.50 | |
| Other | -0.28 | -10, 9.8 | 0.96 | |
| ED Behavioral Health Screen | 7917 | 0.63 | -1.1, 2.4 | 0.48 |
| BHS Depression Score | 7917 | |||
| Mild Depression | — | — | ||
| Moderate Depression | 5.6 | -1.4, 13 | 0.12 | |
| Severe Depression | 8.3 | 4.1, 13 | <0.001 | |
| (Not Assessed) | 6.4 | 2.4, 10 | 0.002 | |
| BHS Suicidal Ideation Score | 7917 | |||
| No past or current SI | — | — | ||
| Current SI | 8.3 | -5.8, 22 | 0.25 | |
| Lifetime SI | 5.4 | -3.8, 15 | 0.25 | |
| (Not Assessed) | 9.0 | 4.1, 14 | <0.001 | |
| ASQ Suicidal Ideation | 7917 | 20 | 19, 22 | <0.001 |
| ASQ Suicide Attempt | 7917 | 24 | 22, 27 | <0.001 |
| Mental Health Note | 7917 | 14 | 12, 16 | <0.001 |
| Psych Tech Note | 7917 | 28 | 27, 30 | <0.001 |
| BHIP Consult | 7917 | 18 | 16, 19 | <0.001 |
| Medically Clear | 7917 | 25 | 23, 27 | <0.001 |
| Behavioral Health Medication Given | 7917 | 30 | 26, 33 | <0.001 |
| Agitation Order Set | 7917 | 0.19 | -3.8, 4.2 | 0.92 |
| ED BH Com Order Set | 7917 | 11 | 1.6, 21 | 0.022 |
| EDECU BH Order Set | 7917 | 122 | 116, 128 | <0.001 |
| Lorazepam | 7917 | 14 | 9.5, 18 | <0.001 |
| Haloperidol | 7917 | 5.5 | -3.4, 14 | 0.22 |
| Diphenhydramine | 7917 | 39 | 34, 44 | <0.001 |
| Olanzapine | 7917 | 7.8 | -7.7, 23 | 0.33 |
| Class Antianxiety | 7917 | 13 | 9.2, 17 | <0.001 |
| Class Antihistamine | 7917 | 39 | 34, 44 | <0.001 |
| Class Antipsychotic | 7917 | 2.7 | -4.7, 10 | 0.47 |
| Safety Risk Orders | 7917 | 18 | 16, 19 | <0.001 |
| Restraints | 7917 | 7.2 | 3.0, 11 | <0.001 |
| Care Suicidal Patient Proc | 7917 | 32 | 30, 35 | <0.001 |
| Search Patients Risk Self Harm | 7917 | 36 | 35, 38 | <0.001 |
| Visual And Arms Length | 7917 | 8.8 | 6.5, 11 | <0.001 |
| Visual Observation | 7917 | 19 | 17, 21 | <0.001 |
| IP Suicide Teaching | 7917 | 4.3 | 0.43, 8.1 | 0.029 |
| ED BH Pathway | 7917 | 18 | 17, 20 | <0.001 |
|
1
CI = Confidence Interval
|
||||
Analyzing the influence of all of the variables together on LOS.
Key Findings: Total Length of Stay was greater for
Patients 9-12 compared to Patients 5-8
Non-Hispanic black compared to Non-Hispanic White
Bucks, Delaware, Montgomery County compared to Philadelphia
Medical Assistance compared to Commercial Insurance
Mental Health Diagnosis compared to Medical Diagnosis
Not ordering safety procedures compared to Ordering
Ordering specific medications compared to Not ordering
lm_full_model <- lm(total_ed_hrs ~ ., data = df_pat_lm)
lm_full_model %>%
tbl_regression(
show_single_row= vars(ends_with("ind")),
pvalue_fun = ~style_pvalue(.x, digits = 2)
) %>%
bold_p(t = 0.10) %>%
bold_labels() %>%
italicize_levels() %>%
modify_caption("**Multiple Regression: Predictors of Length of Stay**") %>%
modify_header(label ~ "**Variable**") %>%
add_glance_source_note()| Variable | Beta | 95% CI1 | p-value |
|---|---|---|---|
| Age Group | |||
| 5-8 | — | — | |
| 9-12 | 4.0 | 1.3, 6.6 | 0.003 |
| 13-15 | -1.5 | -4.1, 1.2 | 0.28 |
| 16-18 | -1.4 | -4.1, 1.4 | 0.34 |
| Sex | |||
| Male | — | — | |
| Female | 0.88 | -0.62, 2.4 | 0.25 |
| Unknown | -28 | -87, 31 | 0.35 |
| Race Ethnicity | |||
| Non-Hispanic White | — | — | |
| Asian | 1.6 | -2.6, 5.7 | 0.45 |
| Hispanic or Latino | -0.89 | -3.7, 1.9 | 0.53 |
| Non-Hispanic Black | 1.7 | -0.16, 3.6 | 0.072 |
| Other | 2.0 | -0.70, 4.7 | 0.15 |
| County | |||
| Philadelphia | — | — | |
| Bucks | 3.5 | 0.33, 6.7 | 0.031 |
| Chester | 0.10 | -3.9, 4.1 | 0.96 |
| Delaware | 2.3 | 0.22, 4.4 | 0.030 |
| Montgomery | 3.8 | 1.3, 6.2 | 0.003 |
| Other | 2.2 | -0.06, 4.4 | 0.056 |
| Preferred Language | |||
| English | — | — | |
| Spanish | 3.1 | -2.8, 9.0 | 0.30 |
| Other | 2.1 | -4.2, 8.4 | 0.51 |
| Payor Group | |||
| Medical Assistance | — | — | |
| Charity Care | 3.5 | -55, 62 | 0.91 |
| Commercial | -1.8 | -3.4, -0.14 | 0.033 |
| Other | -4.8 | -9.8, 0.13 | 0.056 |
| Mychop Activation | -0.45 | -2.0, 1.1 | 0.57 |
| Primary Diagnosis Is BH | 7.2 | 4.3, 10 | <0.001 |
| Primary BH Diagnosis Name | |||
| (Medical diagnosis) | — | — | |
| Aggression, agitation, anger | -2.2 | -5.1, 0.72 | 0.14 |
| Altered mental status | -6.5 | -11, -2.3 | 0.003 |
| Anxiety disorders | -7.2 | -11, -3.3 | <0.001 |
| Eating disorders | -17 | -20, -13 | <0.001 |
| Hallucinations | -11 | -19, -2.6 | 0.010 |
| Other mental health condition | 3.8 | -13, 21 | 0.66 |
| Somatic disorders | -7.5 | -16, 1.1 | 0.086 |
| Substances use disorders | -5.5 | -8.9, -2.1 | 0.002 |
| Suicidal ideation, self-injury | |||
| Primary Medical Diagnosis Name | |||
| (BH diagnosis) | — | — | |
| Abdominal And Pelvic Pain | 2.6 | -2.7, 7.9 | 0.34 |
| Convulsions, Not Elsewhere Classified | 1.8 | -4.9, 8.6 | 0.60 |
| Nausea And Vomiting | 1.7 | -5.3, 8.8 | 0.63 |
| Overdose | -9.0 | -14, -3.7 | <0.001 |
| Pain In Throat And Chest | 0.18 | -6.6, 7.0 | 0.96 |
| Other | 0.70 | -2.0, 3.4 | 0.61 |
| Complex Chronic Condition | -0.49 | -2.6, 1.6 | 0.64 |
| Medically Complex | 1.8 | -1.0, 4.6 | 0.21 |
| Arrival Shift | |||
| Day (8a-4p) | — | — | |
| Evening (4p-12a) | 0.08 | -1.4, 1.5 | 0.92 |
| Overnight (12a-8a) | -1.8 | -4.4, 0.68 | 0.15 |
| Week Day | |||
| Mon | — | — | |
| Tue | 1.3 | -1.0, 3.6 | 0.28 |
| Wed | 3.3 | 0.94, 5.6 | 0.006 |
| Thu | 1.4 | -0.93, 3.8 | 0.24 |
| Fri | 2.4 | -0.08, 4.8 | 0.058 |
| Sat | 3.4 | 0.66, 6.1 | 0.015 |
| Sun | 1.9 | -0.73, 4.6 | 0.16 |
| School Month | 1.3 | -0.55, 3.2 | 0.16 |
| ED Arrival Mode | |||
| Car | — | — | |
| Ems-other | -3.4 | -10, 3.3 | 0.32 |
| Not Applicable | 0.55 | -1.0, 2.1 | 0.50 |
| Private Vehicle | -1.7 | -3.7, 0.38 | 0.11 |
| Other | 1.6 | -1.4, 4.6 | 0.28 |
| Psych Emergency Cc | 4.4 | 1.5, 7.3 | 0.003 |
| Altered Mental Status Cc | -0.88 | -5.9, 4.1 | 0.73 |
| Mental Health Cc | -3.9 | -6.7, -1.1 | 0.007 |
| Hr 72 Revisit | 0.34 | -4.2, 4.9 | 0.88 |
| ED Discharge Destination | |||
| Patient/family/home | — | — | |
| Not Applicable | 3.2 | 1.1, 5.3 | 0.003 |
| Transfer To Another Facility | -1.0 | -7.9, 6.0 | 0.79 |
| Transfer To Psych Facility | -3.8 | -8.5, 0.86 | 0.11 |
| Transfer To Rehab-cssh | 2.3 | -8.9, 13 | 0.69 |
| Other | 2.5 | -5.9, 11 | 0.56 |
| ED Behavioral Health Screen | 1.2 | -2.9, 5.3 | 0.57 |
| BHS Depression Score | |||
| Mild Depression | — | — | |
| Moderate Depression | 3.5 | -2.6, 9.6 | 0.26 |
| Severe Depression | 0.52 | -3.7, 4.8 | 0.81 |
| (Not Assessed) | |||
| BHS Suicidal Ideation Score | |||
| No past or current SI | — | — | |
| Current SI | -2.8 | -14, 8.5 | 0.63 |
| Lifetime SI | -2.1 | -9.5, 5.4 | 0.58 |
| (Not Assessed) | |||
| ASQ Suicidal Ideation | -0.66 | -3.1, 1.8 | 0.60 |
| ASQ Suicide Attempt | 4.8 | 2.3, 7.3 | <0.001 |
| Mental Health Note | -4.2 | -6.2, -2.1 | <0.001 |
| Psych Tech Note | 14 | 12, 16 | <0.001 |
| BHIP Consult | 5.8 | 3.7, 8.0 | <0.001 |
| Medically Clear | 5.1 | 3.2, 7.1 | <0.001 |
| Behavioral Health Medication Given | -18 | -34, -3.1 | 0.018 |
| Agitation Order Set | -0.58 | -16, 15 | 0.94 |
| ED BH Com Order Set | 13 | -1.4, 27 | 0.078 |
| EDECU BH Order Set | 90 | 75, 106 | <0.001 |
| Lorazepam | 27 | 11, 44 | 0.001 |
| Haloperidol | 17 | 0.62, 34 | 0.042 |
| Diphenhydramine | 13 | 7.2, 19 | <0.001 |
| Olanzapine | 22 | 3.7, 40 | 0.018 |
| Class Antianxiety | -20 | -38, -3.3 | 0.019 |
| Class Antihistamine | |||
| Class Antipsychotic | -21 | -37, -4.3 | 0.013 |
| Safety Risk Orders | -6.8 | -11, -3.0 | <0.001 |
| Restraints | -3.8 | -8.2, 0.63 | 0.092 |
| Care Suicidal Patient Proc | -3.5 | -6.9, -0.14 | 0.041 |
| Search Patients Risk Self Harm | 30 | 27, 33 | <0.001 |
| Visual And Arms Length | -9.1 | -12, -6.4 | <0.001 |
| Visual Observation | 3.1 | -0.42, 6.6 | 0.085 |
| IP Suicide Teaching | -16 | -19, -12 | <0.001 |
| ED BH Pathway | 3.2 | 1.2, 5.3 | 0.002 |
| R² = 0.374; Adjusted R² = 0.366; Sigma = 29.5; Statistic = 50.9; p-value = <0.001; df = 88; Log-likelihood = -36,428; AIC = 73,035; BIC = 73,659; Deviance = 6,524,089; Residual df = 7,505; No. Obs. = 7,594 | |||
|
1
CI = Confidence Interval
|
|||
Predicting prolonged LOS from the variables selected for analysis. Interpreting the Odds Ratio (OR) means that positive values indicate a higher likelihood that the variable has a higher chance of having a prolonged length of stay.
Findings:
Being a female patient and Non-Hispanic Blacks were associated with prolonged length of stays in comparison to male and Non-Hispanic White patients.
Having a primary diagnosis that was behavioral health was associated with prolonged length of stays. Among the behavioral health diagnoses, conditions such as anxiety, substance use, and aggression, agitation, and anger were associated with longer length of stays in comparison to medical diagnosis. This is consistent with the findings that having a chief complaint of psych emergency or a general mental health chief complaint was associated with prolonged length of stays.
Arriving at the ED in the evening and overnight were associated with prolonged length of stays in comparison to arrivals earlier in the day.
Among the safety orders available, having any of the safety orders except for restraints was associated with a longer length of stay.
Medications ordered did not have a significant association, nor did depression scores or suicidal ideation levels.
df_pat_glm <- df %>%
select(all_of(lm_vars), ed_los_hrs_cat, -total_ed_hrs) %>%
mutate(ed_los_hrs_cat = recode_factor(ed_los_hrs_cat, "ED LOS < 24" = 1, "ED LOS >= 24" = 0))
glm_full_model <- glm(ed_los_hrs_cat ~ .,
data = df_pat_glm,
family = binomial()
)
glm_full_model %>%
tbl_regression(
exponentiate = TRUE,
show_single_row = vars(ends_with("ind")),
pvalue_fun = ~ style_pvalue(.x, digits = 2)
) %>%
bold_p(t = 0.10) %>%
bold_labels() %>%
italicize_levels() %>%
modify_caption("**Logistic Regression: Predictors of Prolonged Length of Stay**") %>%
modify_header(label ~ "**Variable**") %>%
add_significance_stars(hide_ci = FALSE, hide_p = FALSE) | Variable | OR1,2 | SE2 | 95% CI2 | p-value |
|---|---|---|---|---|
| Age Group | ||||
| 5-8 | — | — | — | |
| 9-12 | 1.12 | 0.309 | 0.62, 2.09 | 0.71 |
| 13-15 | 0.91 | 0.310 | 0.50, 1.70 | 0.77 |
| 16-18 | 0.86 | 0.324 | 0.46, 1.66 | 0.65 |
| Sex | ||||
| Male | — | — | — | |
| Female | 1.39* | 0.138 | 1.06, 1.83 | 0.016 |
| Unknown | 0.00 | 10,754 | >0.99 | |
| Race Ethnicity | ||||
| Non-Hispanic White | — | — | — | |
| Asian | 1.63 | 0.373 | 0.77, 3.34 | 0.19 |
| Hispanic or Latino | 1.18 | 0.245 | 0.73, 1.89 | 0.51 |
| Non-Hispanic Black | 1.43* | 0.161 | 1.05, 1.97 | 0.026 |
| Other | 0.99 | 0.242 | 0.62, 1.59 | 0.98 |
| County | ||||
| Philadelphia | — | — | — | |
| Bucks | 1.42 | 0.276 | 0.82, 2.43 | 0.21 |
| Chester | 1.83 | 0.371 | 0.87, 3.74 | 0.10 |
| Delaware | 1.07 | 0.170 | 0.76, 1.49 | 0.70 |
| Montgomery | 1.55* | 0.208 | 1.03, 2.33 | 0.035 |
| Other | 0.78 | 0.236 | 0.49, 1.23 | 0.29 |
| Preferred Language | ||||
| English | — | — | — | |
| Spanish | 0.96 | 0.556 | 0.31, 2.75 | 0.94 |
| Other | 2.81 | 0.531 | 0.95, 7.64 | 0.052 |
| Payor Group | ||||
| Medical Assistance | — | — | — | |
| Charity Care | 0.00 | 10,754 | >0.99 | |
| Commercial | 0.73* | 0.148 | 0.54, 0.97 | 0.030 |
| Other | 0.32* | 0.482 | 0.12, 0.80 | 0.020 |
| Mychop Activation | 1.15 | 0.130 | 0.89, 1.49 | 0.27 |
| Primary Diagnosis Is BH | 2.49*** | 0.234 | 1.59, 3.98 | <0.001 |
| Primary BH Diagnosis Name | ||||
| (Medical diagnosis) | — | — | — | |
| Aggression, agitation, anger | 0.73 | 0.197 | 0.50, 1.08 | 0.12 |
| Altered mental status | 0.14 | 1.05 | 0.01, 0.73 | 0.063 |
| Anxiety disorders | 0.31* | 0.600 | 0.08, 0.91 | 0.049 |
| Eating disorders | 0.00 | 323 | 0.00, 0.00 | 0.96 |
| Hallucinations | 0.30 | 0.757 | 0.06, 1.19 | 0.11 |
| Other mental health condition | 0.41 | 2.03 | 0.01, 8.62 | 0.66 |
| Somatic disorders | 0.00 | 1,422 | 0.00, 0.00 | >0.99 |
| Substances use disorders | 0.51** | 0.247 | 0.31, 0.83 | 0.007 |
| Suicidal ideation, self-injury | ||||
| Primary Medical Diagnosis Name | ||||
| (BH diagnosis) | — | — | — | |
| Abdominal And Pelvic Pain | 0.95 | 1.08 | 0.05, 5.25 | 0.96 |
| Convulsions, Not Elsewhere Classified | 1.23 | 1.09 | 0.06, 7.12 | 0.85 |
| Nausea And Vomiting | 0.00 | 1,119 | 0.00, 0.00 | 0.99 |
| Overdose | 1.00 | 0.344 | 0.51, 1.96 | >0.99 |
| Pain In Throat And Chest | 0.00 | 1,099 | 0.00, 0.00 | 0.99 |
| Other | 1.48 | 0.267 | 0.88, 2.51 | 0.14 |
| Complex Chronic Condition | 0.62* | 0.205 | 0.41, 0.92 | 0.020 |
| Medically Complex | 0.79 | 0.361 | 0.38, 1.57 | 0.50 |
| Arrival Shift | ||||
| Day (8a-4p) | — | — | — | |
| Evening (4p-12a) | 0.74* | 0.127 | 0.58, 0.95 | 0.020 |
| Overnight (12a-8a) | 0.72 | 0.210 | 0.48, 1.09 | 0.12 |
| Week Day | ||||
| Mon | — | — | — | |
| Tue | 0.92 | 0.204 | 0.62, 1.37 | 0.67 |
| Wed | 1.00 | 0.208 | 0.67, 1.51 | 0.99 |
| Thu | 0.68 | 0.210 | 0.45, 1.02 | 0.065 |
| Fri | 0.72 | 0.221 | 0.47, 1.12 | 0.15 |
| Sat | 0.97 | 0.236 | 0.61, 1.54 | 0.89 |
| Sun | 1.44 | 0.233 | 0.91, 2.27 | 0.12 |
| School Month | 1.11 | 0.174 | 0.79, 1.56 | 0.56 |
| ED Arrival Mode | ||||
| Car | — | — | — | |
| Ems-other | 0.56 | 0.517 | 0.19, 1.45 | 0.26 |
| Not Applicable | 0.75* | 0.133 | 0.58, 0.97 | 0.029 |
| Private Vehicle | 0.60* | 0.227 | 0.38, 0.93 | 0.025 |
| Other | 0.85 | 0.254 | 0.51, 1.39 | 0.52 |
| Psych Emergency Cc | 1.87* | 0.285 | 1.08, 3.29 | 0.028 |
| Altered Mental Status Cc | 0.18 | 1.11 | 0.01, 1.08 | 0.12 |
| Mental Health Cc | 0.47* | 0.332 | 0.24, 0.89 | 0.023 |
| Hr 72 Revisit | 1.24 | 0.466 | 0.48, 2.96 | 0.64 |
| ED Discharge Destination | ||||
| Patient/family/home | — | — | — | |
| Not Applicable | 2.27*** | 0.210 | 1.51, 3.45 | <0.001 |
| Transfer To Another Facility | 0.90 | 0.478 | 0.34, 2.23 | 0.83 |
| Transfer To Psych Facility | 0.81 | 0.298 | 0.45, 1.45 | 0.48 |
| Transfer To Rehab-cssh | 12.4* | 1.20 | 0.56, 89.0 | 0.036 |
| Other | 4.78* | 0.665 | 1.18, 16.5 | 0.019 |
| ED Behavioral Health Screen | 1.10 | 0.706 | 0.23, 3.74 | 0.90 |
| BHS Depression Score | ||||
| Mild Depression | — | — | — | |
| Moderate Depression | 1.08 | 0.844 | 0.22, 6.37 | 0.93 |
| Severe Depression | 1.04 | 0.710 | 0.30, 4.98 | 0.96 |
| (Not Assessed) | ||||
| BHS Suicidal Ideation Score | ||||
| No past or current SI | — | — | — | |
| Current SI | 1.88 | 1.00 | 0.28, 14.6 | 0.53 |
| Lifetime SI | 0.22 | 0.98 | 0.03, 1.60 | 0.12 |
| (Not Assessed) | ||||
| ASQ Suicidal Ideation | 1.28 | 0.173 | 0.91, 1.80 | 0.15 |
| ASQ Suicide Attempt | 1.21 | 0.157 | 0.89, 1.65 | 0.22 |
| Mental Health Note | 1.27 | 0.302 | 0.71, 2.34 | 0.43 |
| Psych Tech Note | 17.5*** | 0.237 | 11.1, 28.2 | <0.001 |
| BHIP Consult | 1.43* | 0.168 | 1.03, 1.99 | 0.032 |
| Medically Clear | 1.23 | 0.130 | 0.95, 1.59 | 0.11 |
| Behavioral Health Medication Given | 0.46 | 1.01 | 0.06, 3.15 | 0.44 |
| Agitation Order Set | 1.30 | 1.05 | 0.17, 10.6 | 0.80 |
| ED BH Com Order Set | 1.17 | 0.930 | 0.18, 6.93 | 0.87 |
| EDECU BH Order Set | 26.0** | 1.05 | 3.67, 227 | 0.002 |
| Lorazepam | 5.19 | 1.48 | 0.39, 83.6 | 0.26 |
| Haloperidol | 0.23 | 1.04 | 0.03, 2.00 | 0.16 |
| Diphenhydramine | 0.68 | 0.420 | 0.30, 1.54 | 0.36 |
| Olanzapine | 0.53 | 1.23 | 0.05, 6.07 | 0.60 |
| Class Antianxiety | 0.25 | 1.49 | 0.02, 3.61 | 0.36 |
| Class Antihistamine | ||||
| Class Antipsychotic | 3.95 | 0.98 | 0.51, 26.0 | 0.16 |
| Safety Risk Orders | 0.20** | 0.496 | 0.07, 0.52 | 0.001 |
| Restraints | 1.23 | 0.285 | 0.70, 2.14 | 0.47 |
| Care Suicidal Patient Proc | 0.59** | 0.175 | 0.42, 0.82 | 0.002 |
| Search Patients Risk Self Harm | 27.0*** | 0.198 | 18.4, 40.1 | <0.001 |
| Visual And Arms Length | 0.30*** | 0.159 | 0.22, 0.40 | <0.001 |
| Visual Observation | 2.91** | 0.394 | 1.41, 6.74 | 0.007 |
| IP Suicide Teaching | 0.47*** | 0.202 | 0.31, 0.69 | <0.001 |
| ED BH Pathway | 1.28 | 0.129 | 0.99, 1.65 | 0.058 |
|
1
*p<0.05; **p<0.01; ***p<0.001
2
OR = Odds Ratio, SE = Standard Error, CI = Confidence Interval
|
||||
library(sjPlot)
plot_model(glm_full_model, sort.est = TRUE, show.values = TRUE, value.offset = 2.0, transform = NULL) + theme_chop()Patient factors are related to length of stay, consistent with the literature: Age, Race Ethnicity, Sex, and Insurance .
Suggests further analysis for whether there are socioeconomic disparities and what ED practices may contribute to them.
ED factors and clinical activities had some influence as well Consultation with psychiatry and needing safety orders suggests likely higher acuity and intervention needed.
Next steps Consider using predictive modeling techniques Varying prolonged LOS cutoffs.
Limitations: Lots of missing data as not all factors are consistently measured. Limited the ability to do predictive analyses.
Extra analyses for my curiosity.
Daily Census for the ED. This measures the number of patients who were in the ED on a given day. Includes new patients as well as those previously admitted but not yet discharged.
df_daily_ed_patients <- df %>%
select(census_date, visit_key) %>%
remove_incomplete_end_dates(census_date, period = 'month') %>%
add_date_columns(census_date) %>%
group_by(census_date_month) %>%
summarize(count = n())
hc_spc(
data = df_daily_ed_patients,
x = census_date_month,
y = count,
chart = "c",
title = "Median Number of Patients Present in the ED", xlab = "Month Year", ylab = "Patients", agg.fun = "median"
)Examining the total of new patients admitted to the ED during the period. Does not include patients who were already present in the ED.
df_admission_count <- df %>%
rocqi::remove_incomplete_end_dates(ed_admit_date, period = 'month') %>%
group_by(ed_admit_date) %>%
summarise(count = n())
hc_spc(
data = df_admission_count, x = ed_admit_date,
y = count, chart = "c",
ylab = "Total Admissions"
)This chart illustrates the location where the patient was discharged from and the disposition recommended by the BHIP and Social Work teams.
df_hc <- df %>%
#filter(df$encounter_date >= '2021-01-01') %>%
select(ed_discharge_location, bh_discharge_disposition) %>%
drop_na() %>%
data_to_sankey() %>%
mutate(to = as.factor(to)) %>%
mutate(to = fct_reorder(to, weight, .desc = TRUE) )
hchart((df_hc), "sankey", name = "Behavioral Health Patient Discharge Dispositions") %>%
hc_title(text= "Behavioral Health Patient Discharge Dispositions") %>%
hc_subtitle(text= "CHOP Unit to BH Disposition") %>%
hc_tooltip(pointFormat = "<b>Value:</b> {point.weight} <br>
<b>Percentage</b> {point.percentage:,.2f}%")Comparing the ED Length of Stay to the disposition recommendations by the behavioral health team.
df_hc_long_los <- df %>%
#filter(df$encounter_date >= '2021-01-01') %>%
select(ed_los_hrs_cat, bh_discharge_disposition) %>%
drop_na() %>%
data_to_sankey() %>%
mutate(to = as.factor(to)) %>%
mutate(to = fct_reorder(to, weight, .desc = TRUE) ) %>%
group_by(from) %>%
mutate(percentage = (weight/sum(weight))*100)
hchart((df_hc_long_los), "sankey", name = "Prolonged LOS Dispositions") %>%
hc_title(text= "Behavioral Health Patient Discharge Dispositions") %>%
#hc_subtitle(text= "CHOP Unit to BH Disposition") %>%
hc_tooltip(pointFormat = "<b>Value:</b> {point.weight} <br>
<b>Percentage</b> {point.percentage:,.2f}%")This is the relationship between the primary ED diagnosis and the disposition recommendations by the behavioral health team.
df_hc_dx_dispo <- df %>%
filter(primary_diagnosis_is_bh_ind ==1) %>%
select(primary_bh_diagnosis_name, bh_discharge_disposition) %>%
drop_na() %>%
data_to_sankey() %>%
mutate(to = as.factor(to)) %>%
mutate(to = fct_reorder(to, weight, .desc = TRUE) ) %>%
group_by(from) %>%
mutate(percentage = (weight/sum(weight))*100)
hchart((df_hc_dx_dispo), "sankey", name = "Prolonged LOS Dispositions") %>%
hc_title(text= "Behavioral Health Diagnosis and Disposition Recommendations") %>%
#hc_subtitle(text= "CHOP Unit to BH Disposition") %>%
hc_tooltip(pointFormat = "<b>Value:</b> {point.weight} <br>
<b>Percentage</b> {point.percentage:,.2f}%")Inpatient Psychiatric Facility counts by the location where the patient was discharged from.
df_ip_psych_transfer <- df %>%
select(csn , ed_discharge_location, ed_psych_discharge_location) %>%
filter(ed_discharge_location %in% c('ED', 'EDECU')) %>%
group_by(ed_discharge_location, ed_psych_discharge_location) %>%
summarise(count = n()) %>%
pivot_wider(names_from = ed_discharge_location, values_from = count) %>%
group_by(ed_psych_discharge_location) %>%
filter(!is.na(ed_psych_discharge_location)) %>%
mutate("Total" = sum(c(ED,EDECU), na.rm=TRUE)) %>%
rename("Psychiatric Facility" = ed_psych_discharge_location) %>%
format_data_frame(keep_uppercase = c("bh", "edecu", "bhs", "bhip", "mh", "ed", "csn", "mrn", "ip"))
df_ip_psych_transfer %>%
kbl() %>%
kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive"))| Psychiatric Facility | ED | EDECU | Total |
|---|---|---|---|
| Belmont | 11 | 100 | 111 |
| Devereux | 1 | 8 | 9 |
| Fairmount | 4 | 159 | 163 |
| Foundations | 6 | 16 | 22 |
| Friends | 8 | 46 | 54 |
| Horsham Clinic | 4 | 112 | 116 |
| Kids Clinic | NA | 11 | 11 |
| Rockford | NA | 7 | 7 |
Mental Health Note: Patient had at least one note (MH-type) documented during the admission by the behavioral health inpatient (BHIP) consult team.
Psych Tech Note: Patient had at least one note documented by a psychiatry tech during the admission.
Safety Risk Orders: Patient had at least one of the following safety risk orders during their admission.
Restraints
Visual & Arms Length
Visual Observation Care of the Suicidal
Patient Searching Patients at Risk for Self-Harm
IP Suicide Teaching
ED Pathway
Behavioral Health Behavioral Health Screen - ED: Patient has been screened using the behavioral health screen in the ED and obtained either a depression score of ‘Severe Depression’ or an ideation score of ‘Current Suicidal Thoughts.’
Social Work Disposition: Patient has a discharge disposition documented during the admission from the social work team.
BHIP Disposition: Patient has a discharge disposition documented during the admission from the BHIP team.
Medical Clearance: Patient has a medical clearance date documented during their admission.
Primary Diagnosis: Patient’s primary diagnosis during admission was of an ICD-10 diagnosis.
Medication Intervention: Patient any of the following Order Sets placed during their admission.
Agitation Medications
ED Behavioral Health Complaint Pathway
EDECU Behavioral Health Order Set
Medically Complex: Indicates whether a patient is listed as medically complex, which is either two complex chronic conditions, or one CCC and is reported as technology dependent.
Complex Chronic Condition: Indicates whether a patient has a complex chronic condition (CCC) based on specific diagnoses on their problem list, or if they have a specific visit diagnosis made in the past year. CCCs are grouped in to the following categories based on organ group - Hematology, Renal, GI, Malignancy, Neonatal, Congenital Genetics, Respiratory, Cardiovascular Disease, and Neuromuscular.